<template>
	<!-- D:/project/app/ydz-app-uniapp/static/images/login -->
	<view class="pagebody" :style="{ minheight: maxHeight }">
		<view class="topbgbox">
			<view class="justify-between align-center">
				<image @click="backpage" src="@/static/images/login/leftjt.png" alt="" style="width: 48rpx;height: 48rpx;"></image>

			</view>
			<view class="color303b39 fwbold" style="font-size: 60rpx;margin-top: 64rpx;margin-left: 23rpx;">
				验证手机号
			</view>
			<view class="color303b39 fz32" style="margin-top: 32rpx;margin-left: 23rpx;">
				欢迎来到药队长!
			</view>
			<view class="fz32 color303b39 flex-row align-center" style="margin-top: 100rpx;">
				<span style="color: #576260;margin-right: 24rpx;">国家/地区</span>中国+86<image
					src="@/static/images/login/rightjt.png" alt="" style="width: 32rpx;height: 32rpx;"></image>
			</view>
			<view class="inputbox" style="margin-top: 48rpx;">
				<uni-easyinput v-model="phone" :placeholderStyle="placeholderStyle"
					placeholder="请输入手机号"></uni-easyinput>

			</view>
			<view class="align-center loginbtn justify-between">
				<button class="button fwbold" :style="{opacity:phone.length>0?'1':'0.5'}"
					:disabled="phone.length>0?false:true" type="primary" @click="login">下一步</button>
			</view>
		</view>
		<u-toast ref="uToast" />



	</view>
</template>

<script>
	export default {
		onLoad() {
			// 获得屏幕最大高度
			let systemInfo = uni.getSystemInfoSync();
			this.maxHeight = systemInfo.windowHeight + "px";
		},
		data() {
			return {
				maxHeight: '',
				phone: '',
				placeholderStyle: "color:#7E8987;font-size:32rpx",
			}
		},
		methods: {
			login: function(e) {
				var pattern = /^(?:(?:\+|00)86)?1[3-9]\d{9}$/;
				if(pattern.test(this.phone)==false){
					this.$refs.uToast.show({
						title: '请输入正确的手机号',
					})
					return
				}else {
					this.$modal.loading("请耐心等待...")
					uni.navigateTo({ url: `/pages/login/verifycode?phone=`+this.phone+`&type=forget`+'&operateId=3' });
				}

			},
			showToast() {
				this.$refs.uToast.show({
					title: '登录成功',
					type: 'success',
					url: '/pages/user/index'
				})
			},
			backpage(){
				uni.navigateBack({
				    delta: 1
				});
			}
		}
	};
</script>

<style lang="scss" scoped>
	page {
		background: #fff;
	}

	::v-deep .is-input-border {
		border: none;
	}

	::v-deep .uni-easyinput__content {
		background: transparent !important;
	}

	::v-deep .uni-input-input {
		font-size: 32rpx;
	}

	::v-deep uni-checkbox .uni-checkbox-input {
		background: transparent;
	}

	::v-deep uni-checkbox .uni-checkbox-input.uni-checkbox-input-checked {
		color: #fff;
		border-color: #00D9B2;
		background: #00D9B2;
	}

	::v-deep .uni-icons {
		font-size: 52rpx !important;
	}

	::v-deep uni-toast {
		font-size: 24rpx;
	}

	.pagebody {
		box-sizing: border-box;
		background-image: url('/static/images/login/otherbg.png');
		position: relative;
		background-repeat: no-repeat;
		background-size: cover;

		.topbgbox {
			// position: relative;
			// height: 9.2100rpx;
			box-sizing: border-box;
			padding: 14rpx 40rpx 0;


			.inputbox {
				border-bottom: 1px solid #B8C3C1;
				padding-bottom: 10rpx;
			}

			.loginbtn {
				// position: absolute;
				// bottom: 0;
				margin-top: 96rpx;

				uni-button {
					border-radius: 98rpx;
					width: 668rpx;
				}

				uni-button:after {
					border: none;
				}

				.button {
					background-color: #00D9B2;
					display: flex;
					align-items: center;
					justify-content: center;
					font-size: 36rpx;

				}
			}
		}

	}
</style>